package main

import (
	. "fmt"
	//"unicode/utf8"
)

func main() {
	//cut chinese to 100 word
	cw := "输入中文字母截断头10个汉字"
	bytecw := []byte(cw)
	runecw := []rune(cw)
	//Println(bytecw, len(bytecw)) // 39
	//return [232 190 147 229 133 165 228 184 173 230 150 135 229 173 151 230 175 141 230 136 170 230 150 173 229 164 180 49 48 48 228 184 170 230 177 137 229 173 151]
	//Println(runecw, len(runecw)) //15
	//return [36755 20837 20013 25991 23383 27597 25130 26029 22836 49 48 48 20010 27721 23383]

	Println(string(runecw[:10]))
	//Println(utf8.RuneStart(runecw[0]))
	//Println(len(bytecw) == len(cw))
	//Println(len(bytecw[:10]), string(bytecw[:10]))
	//Println(utf8.DecodeLastRune(bytecw))
}
